package org.msd.controller;
import org.msd.model.Commodity;
import org.msd.service.iml.ZoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
@RequestMapping("/Pay")
public class PayController {
    @Autowired
    private ZoomService zoomService;
    /*
    点击支付接收id
     */
    @RequestMapping("payid")
    public String PAY(@RequestParam("commodityid") int commodityid, @RequestParam("username") String username, Model model){
        /*
        将前端要支付的商品id传递到后台
         */
        //Paymentpage就是支付页面
        Commodity commodity=zoomService.GETProductid(commodityid);
        model.addAttribute("pay",commodity);
        model.addAttribute("username",username);

         return "Paymentpage" ;//支付页面
    }
}
